{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>厚浦博客</title>
    <link href="{% static 'bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'css/cl-css.css' %}" rel="stylesheet">
    <link href="{% static 'font-awesome/css/font-awesome.min.css' %}" rel="stylesheet">
    <link rel="stylesheet" href="{% static 'highlight/styles/railscasts.css' %}">
</head>
<body>
<div id="app">
    <div class="cl-header container-fluid">
        <div class="header-content container">
            <nav class="navbar navbar-expand-lg navbar-light">
                <a class="navbar-brand" href="{% url 'users:index' %}">
                    <img src="../static/img/diugai.com163411741466256.png" width="144" height="100" alt="">
                </a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
                        aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse justify-content-end" id="navbarNav">
                    <ul class="navbar-nav">
                        <li class="nav-item active">
                            <a class="nav-link" href="{% url 'users:index' %}">首页 <span class="sr-only">(current)</span></a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">教程</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">模板</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">日记</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">关于</a>
                        </li>
                        <!-- 如果用户已经登录，则显示用户名下拉框 -->
                        <li class="nav-item dropdown" v-if="is_login">
                            <a class="nav-link dropdown-toggle" href=" " id="navbarDropdown" role="button"
                               data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @click="show_menu_click">[[username]]</a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdown" style="display: block" v-show="show_menu">
                                <a class="dropdown-item" href="../static/write_blog.html">写文章</a>
                                <a class="dropdown-item" href='{% url 'users:usercenter' %}'>个人信息</a>
                                <a class="dropdown-item" href='{% url 'users:logout' %}'>退出登录</a>
                            </div>
                        </li>
                        <!-- 如果用户未登录，则显示登录按钮 -->
                        <li class="nav-item" v-else>
                            <a class="nav-link" href="{% url 'users:login' %}">登录</a>
                        </li>
                    </ul>
                </div>
            </nav>
        </div>
    </div>
    <div class="cl-cantainer container pt-5">
        <form class="col-md-6 offset-md-3" method="post">
            {% csrf_token %}
            <div class="form-group">
                <label for="inputEmail4">手机号码</label>
                <input type="number" class="form-control" id="mobile" name="mobile" placeholder="请输入手机号"
                       autofocus="autofocus" required v-model="mobile" @blur="check_mobile">
                <small class="form-text ml-1">还没有账号,<a href="{% url 'users:register' %}" class="text-primary">注册新号</a></small>
                <small class="form-text text-danger ml-1" v-show="mobile_error">[[mobile_error_message]]</small>
            </div>
            <div class="form-group">
                <label for="id_password">密码</label>
                <input type="password" class="form-control" id="id_password" name="password" placeholder="请输入密码"
                       required class="form-control" v-model="password" @blur="check_password"/>
                <small class="form-text ml-1"> <a href="{% url 'users:forgetpassword' %}" class="text-primary">忘记密码</a></small>
                <small class="form-text text-danger ml-1" v-show="password_error">[[password_error_message]]</small>
            </div>
            <div class="form-group">
                <input type="checkbox" name="remember">保持2周登录
            </div>

            <div class="form-group">
                <button type="submit" class="btn btn-primary btn-block">登录</button>
            </div>
            <div class="form-group">
                <p class=""></p>
            </div>
        </form>
    </div>
    <div class="container-fluid cl-footer">
        <div class="container">
            <p class="cl-copyright">本设计由沈海出品</p>
            <p class="cl-copyright">copyright @ 2021~2022 shenhai（www.shenhai.cn）</p>
        </div>
    </div>
</div>
<script src="{% static 'jquery/jquery.min.js' %}"></script>
<script src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
<script src="{% static 'highlight/highlight.pack.js' %}"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="{% static 'vue/vue-2.5.16.js' %}"></script>
<script src="{% static 'js/host.js' %}"></script>
<script src="{% static 'js/common.js' %}"></script>
<script src="{% static 'js/index.js' %}"></script>
</body>
</html>